home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / mus / play / EaglePlayer101.lha / Eagleplayer101 / Dok / Player / TestPlayer.s < prev    next >
Text File  |  1993-04-21  |  19KB  |  586 lines

  1. **
  2. **    Testplayer.s
  3. **
  4. **    A sample player that visually reports EaglePlayer's actions
  5. **    within external players.
  6. **
  7. **    Use the source as a skeleton model for your own players.
  8. **    Refer to the sample sources for additional information.
  9. **
  10. **    Once assembled, load this player into EaglePlayer, and try
  11. **    playing the file 'testmodule'.  It is only a textfile with
  12. **    the word "TEST" at the beginning.  Notice now that
  13. **    EaglePlayer's actions on the module are visible.  This should
  14. **    aid you in your coding sequences.
  15. **
  16. **    Original source by Peter Kunath and Frank Riffel of Delirium.
  17. **    Changed for EaglePlayer by Eagleeye of DEFECT
  18. **
  19. **    English, comments, and general banter by Kevin Dackiw & Eagleeye.
  20. **
  21. **    Have any problems/concerns/ideas?  Feel free to contact the
  22. **    authors:
  23. **
  24. **    Author from DeliTracker:        Author from EaglePlayer:
  25. **    ------------------------        ------------------------
  26. **    Frank Riffel                Jan Blumenthal
  27. **    Merkstr. 27                Erich-Mühsam-Str.33
  28. **    8129 Wessobrunn                O-2510 Rostock 5
  29. **    Germany                    Germany
  30. **
  31. **    Or myself:
  32. **
  33. **    Kevin Dackiw
  34. **    sikorsky@bode.ee.ualberta.ca (preferred)
  35. **    kevind@ersys.edmonton.ab.ca
  36. **
  37. _LVOOldOpenLibrary    EQU -408        ;exec library offsets
  38. _LVOCloseLibrary    EQU -414
  39.  
  40. _LVOTextRequest        EQU -174        ;offset for TextRequest in Req.
  41.  
  42.         incdir    "include:"
  43.         include    "misc/DeliPlayer.i"
  44.  
  45.         PLAYERHEADER Test_TagArray    ; define start of header
  46.  
  47.     dc.b '$VER: TestPlayer V1.20 (22 March 93)',0    ; for OS 2.0 version command
  48.     even
  49.  
  50. Test_TagArray:
  51.     dc.l    DTP_PlayerVersion,2            ; define all the tags
  52.     dc.l    DTP_PlayerName,Test_Name        ; for the player
  53.     dc.l    DTP_Creator,Test_Creator
  54.     dc.l    DTP_Check2,Check            ; omit any unused
  55.     dc.l    DTP_Config,ConfigPlayer            ; functions as
  56.     dc.l    DTP_UserConfig,UserConfig        ; needed!
  57.     dc.l    DTP_SubSongRange,SubSongrange
  58.     dc.l    DTP_InitPlayer,InitPlay
  59.     dc.l    DTP_EndPlayer,EndPlay
  60.     dc.l    DTP_InitSound,InitSnd
  61.     dc.l    DTP_EndSound,EndSnd
  62.     dc.l    DTP_StartInt,StartInt
  63.     dc.l    DTP_StopInt,StopInt
  64.     dc.l    DTP_Volume,Volume
  65.     dc.l    DTP_Balance,Balance
  66.     dc.l    DTP_Faster,Faster
  67.     dc.l    DTP_Slower,Slower
  68.     dc.l    DTP_PrevPatt,PrevPatt
  69.     dc.l    DTP_NextPatt,NextPatt
  70.     dc.l    DTP_PrevSong,PrevSubSong
  71.     dc.l    DTP_NextSong,NextSubSong
  72.  
  73.     dc.l    EP_StructInit,StructInit        ;Init & Get Analyzer
  74.                             ;Structure
  75.     dc.l    EP_StructEnd,StructEnd            ;Free AnalyzerStructure
  76.                             ;if nessesary
  77.  
  78.     dc.l    EP_Get_ModuleInfo,Get_ModuleInfo    ;Get Infotaglist about
  79.     dc.l    EP_Free_ModuleInfo,Free_ModuleInfo    ;Module
  80.  
  81.     dc.l    EP_Voices,Voices            ;Set Voices on/off
  82.     dc.l    EP_SampleInit,SampleInit
  83.     dc.l    EP_SampleEnd,SampleEnd
  84.     dc.l    EP_Save,Save                ;Save the Module
  85.  
  86.     dc.l    EP_ModuleChange,ModuleChange        ;change Playroutine of
  87.                             ;Modules with Player
  88.                             ;in them
  89.     dc.l    EP_ModuleRestore,ModuleRestore        ;restore these Mods,
  90.                             ;for Saving
  91.  
  92.     dc.l    EP_LoadPlConfig,LoadConfig        ;Load & Save the
  93.     dc.l    EP_SavePlConfig,SaveConfig        ;Config of the Player
  94.  
  95.     dc.l    EP_GetPositionNr,GetPositionNr        ;Positionnumber for
  96.                             ;Next/PrevPattern
  97.     dc.l    EP_SetSpeed,SetSpeed
  98. ;    dc.l    EP_CheckModule,CheckModule
  99.  
  100.     dc.l    TAG_DONE                ; signify end of tags
  101.  
  102. *-----------------------------------------------------------------------*
  103. *---- Playername / creatorname and textstructure for our requesters ----*
  104. *-----------------------------------------------------------------------*
  105. Test_Name:    dc.b    'TestPlayer',0
  106. Test_Creator:    dc.b    'Written by Delirium & Eagleeye for Testpurposes',0
  107. Reqname        dc.b    'req.library',0
  108.  
  109. *---------------------- TextStructure für Req.Library --------------------*
  110.     even
  111. TextStruct:
  112.     dc.l    0                    ; ^Text
  113.     dc.l    0                    ; ^ParamList
  114.     dc.l    0                    ; ^Window
  115.     dc.l    0                    ; ^MiddleText
  116.     dc.l    0                    ; ^PositiveText
  117.     dc.l    OKTxt                    ; ^NegativeText
  118.     dc.l    TitleTxt                ; ^Title
  119.     dc.w    $ffff                    ; KeyMask
  120.     dc.w    0                    ; textcol
  121.     dc.w    0                    ; detailcol
  122.     dc.w    0                    ; blockcol
  123.     dc.w    0                    ; versionnumber
  124.     dc.w    0                    ; Timeout
  125.     dc.l    0                    ; abortmask
  126.     dc.l    0                    ; reserved
  127.  
  128. OKTxt:        dc.b    '  OK  ',0
  129. TitleTxt:    dc.b    'TestPlayer-Information',0
  130.  
  131. InitPlayer.TXT:
  132.     dc.b    10
  133.     dc.b    'InitPlayer routine called.',10,10
  134.     dc.b    'This routine is called every time a new module is loaded.',10
  135.     dc.b    'The audiochannels should be allocated here, and any',10
  136.     dc.b    'player specific initialization should be performed.',10
  137.     dc.b    0
  138.  
  139. EndPlayer.TXT:
  140.     dc.b    10
  141.     dc.b    'EndPlayer routine called.',10,10
  142.     dc.b    'This routine is called every time a module is killed',10
  143.     dc.b    '(removed from memory).  Player specific cleanup routines',10
  144.     dc.b    'are performed here, and the audiochannels should be',10
  145.     dc.b    'released at this point.',10
  146.     dc.b    0
  147.  
  148. InitSound.TXT:
  149.     dc.b    10
  150.     dc.b    'InitSound routine called.',10,10
  151.     dc.b    'This routine handles the initialization of the module.',10
  152.     dc.b    0
  153.  
  154. EndSound.TXT:
  155.     dc.b    10
  156.     dc.b    'EndSound routine called.',10,10
  157.     dc.b    'This routine clears the audioregisters.',10
  158.     dc.b    0
  159.  
  160. StartInt.TXT:
  161.     dc.b    10
  162.     dc.b    'StartSound routine called.',10,10
  163.     dc.b    'This code must start the sound interrupts.',10
  164.     dc.b    'If you use the internal DeliTracker routines, you must',10
  165.     dc.b    'delete this entry from the TagArray.',10
  166.     dc.b    0
  167.  
  168. StopInt.TXT
  169.     dc.b    10
  170.     dc.b    'StopSound routine called.',10,10
  171.     dc.b    'This code must stop the sound interrupts.',10
  172.     dc.b    'If you use the internal DeliTracker routines, you must',10
  173.     dc.b    'omit this entry from the TagArray.',10
  174.     dc.b    0
  175.  
  176. UserConfig.TXT:
  177.     dc.b    10
  178.     dc.b    'UserConfig routine called.',10,10
  179.     dc.b    'This routine is for the use of advanced players.',10
  180.     dc.b    'For example, if your player needs access to a directory',10
  181.     dc.b    'of instruments, this routine could prompt the user with',10
  182.     dc.b    'a requester for the path to the instruments.  Additionally',10
  183.     dc.b    'the path could then be saved in a custom config file, such',10
  184.     dc.b    'as s:<playername>.config.  Any future runs of the player',10
  185.     dc.b    'would only then have to fetch the path from its config file.',10
  186.     dc.b    'This custom config file must be accessed from the Config routine.',10
  187.     dc.b    0
  188.  
  189. ConfigPlayer.TXT:
  190.     dc.b    10
  191.     dc.b    'ConfigPlayer routine called.',10,10
  192.     dc.b    'This routine is entered after the player is loaded.',10
  193.     dc.b    'At this point you may load a custom config file to fetch',10
  194.     dc.b    'such things as a default instrument path, and the like.',10
  195.     dc.b    0
  196.  
  197. LoadConfig.TXT:
  198.     dc.b    10
  199.     dc.b    "Load PlayerConfig routine called.",10,10
  200.     dc.b    "This routine loads the players preferences",10
  201.     dc.b    "from ENV:Eagleplayer/<Filename> .",10
  202.     dc.b    "You may e.g. load a config with the",10
  203.     dc.b    "instrument path.",10
  204.     dc.b    0
  205.  
  206. SaveConfig.TXT:
  207.     dc.b    10
  208.     dc.b    "Save PlayerConfig routine called.",10,10
  209.     dc.b    "This routine saves the player preference of",10
  210.     dc.b    "the selected player to ENVArc:EaglePlayer/<Filename>",10
  211.     dc.b    "Usefull for Instruments path.",10
  212.     dc.b    0
  213.  
  214. NextPattern.TXT:
  215.     dc.b    10
  216.     dc.b    'NextPattern routine called.',10,10
  217.     dc.b    'This routine skips ahead one pattern in the module.',10
  218.     dc.b    0
  219.  
  220. PrevPattern.TXT:
  221.     dc.b    10
  222.     dc.b    'PrevPattern routine called.',10,10
  223.     dc.b    'This routine skips back one pattern in the module.',10
  224.     dc.b    0
  225.  
  226. GetPositionNr.TXT:
  227.     dc.b    10
  228.     dc.b    "Get PositionsNr routine called.",10,10
  229.     dc.b    "You have to give the actual Position in Module back",10
  230.     dc.b     `Useful to show on which Position you are ...`,10
  231.     dc.b    0
  232.  
  233. NextSubSong.TXT:
  234.     dc.b    10
  235.     dc.b    'NextSubsong routine called.',10,10
  236.     dc.b    'This routine jumps to the next subsong (if supported).',10
  237.     dc.b    0
  238.  
  239. PrevSubSong.TXT:
  240.     dc.b    10
  241.     dc.b    'PrevSubsong routine called.',10,10
  242.     dc.b    'This routine jumps to the previous subsong (if supported).',10
  243.     dc.b    0
  244.  
  245. SpeedFaster.TXT:
  246.     dc.b    10
  247.     dc.b    'Faster Speed routine called.',10,10
  248.     dc.b    'This routine increases the playspeed.',10
  249.     dc.b    0
  250.  
  251. SpeedSlower.TXT:
  252.     dc.b    10
  253.     dc.b    'Slower Speed routine called.',10,10
  254.     dc.b    'This routine decreases the playspeed.',10
  255.     dc.b    0
  256.  
  257. SetSpeed.TXT:
  258.     dc.b    10
  259.     dc.b    "Set Speed routine called.",10,10
  260.     dc.b    "Here you get & set the Speed in Eagleplayer which you"
  261.     dc.b    "control comfortable by the slider on the left side",10
  262.     dc.b    0
  263.  
  264. SubSongRange.TXT:
  265.     dc.b    10
  266.     dc.b    'SubSongRange routine called.',10,10
  267.     dc.b    'This routine must determine the min & max subsong number.',10
  268.     dc.b    0
  269.  
  270. Volume.TXT:
  271.     dc.b    10
  272.     dc.b    'Volume routine called.',10,10
  273.     dc.b    'This routine controls the volume.',10
  274.     dc.b    0
  275.  
  276. Balance.TXT:
  277.     dc.b    10
  278.     dc.b    'Balance routine called.',10,10
  279.     dc.b    'This routine controls the balance.',10
  280.     dc.b    0
  281.  
  282. Voices.TXT:
  283.     dc.b    10
  284.     dc.b    'Voices routine called.',10,10
  285.     dc.b    `This Routine switches the 4 Voices of Amiga on/off`,10
  286.     dc.b    0
  287.  
  288. Save.TXT:
  289.     dc.b    10
  290.     dc.b    "Save routine called,",10,10
  291.     dc.b    "This routine saves the module.",10
  292.     dc.b    0
  293.  
  294. SampleInit.TXT:
  295.     dc.b    10
  296.     dc.b    "SampleInit routine called,",10,10
  297.     dc.b    "This routine handels the initialization",10
  298.     dc.b    "of the Sample-Taglist.",10
  299.     dc.b    0
  300.  
  301. SampleEnd.TXT:
  302.     dc.b    10
  303.     dc.b    "SampleEnd routine called.",10,10
  304.     dc.b    "This routine has been called every time if a Samplewindow",10
  305.     dc.b    "had been closed.",10
  306.     dc.b    "The player will free the used memory of the",10
  307.     dc.b    "Sample-Taglist.",10
  308.     dc.b    0
  309.  
  310. GetModuleInfo.TXT:
  311.     dc.b    10
  312.     dc.b    "Get_ModuleInfo routine called,",10,10
  313.     dc.b    "This routine handels the initialization",10
  314.     dc.b    "of the ModuleInfo-Taglist",10
  315.     dc.b    0
  316.  
  317. FreeModuleInfo.TXT:
  318.     dc.b    10
  319.     dc.b    "Free ModuleInfo routine called.",10,10
  320.     dc.b    `This Routine will be called if a Module was ejected,`,10
  321.     dc.b    `so that the player could free allocated Memory for the`,10
  322.     dc.b    `Taglist, if needed`,10
  323.     dc.b    0
  324.  
  325. Check.TXT:
  326.     dc.b    10
  327.     dc.b    "Check routine called.",10,10
  328.     dc.b    "This routine will has been called every time a module had",10
  329.     dc.b    "been loaded. The player tests if it knows this",10
  330.     dc.b    "module-format.",10
  331.     dc.b    0
  332.     
  333. ModuleChange.TXT:
  334.     dc.b    10
  335.     dc.b    "Module Change routine called.",10,10
  336.     dc.b    "This routine will be called every time a module with",10
  337.     dc.b    "playroutine within itself has been loaded. The playroutine",10
  338.     dc.b    `will change it to an Analyzer/Volume&Balanceset ...`,10
  339.     dc.b    `compatible replayer`,10
  340.     dc.b    0
  341.     even
  342.  
  343. ModuleRestore.TXT:
  344.     dc.b    10
  345.     dc.b    "Module Restore routine called.",10,10
  346.     dc.b    "This routine has been called every time a module with",10
  347.     dc.b    "playroutine should be saved.",10
  348.     dc.b    "The original replayercode will be restored.",10
  349.     dc.b    0
  350.  
  351. StructInit.TXT:
  352.     dc.b    10
  353.     dc.b    "StructInit routine called.",10,10
  354.     dc.b    "This routine returns a Pointer to an anylyzerstructure.",10
  355.     dc.b    "This structure will be filled by the player.",10
  356.     dc.b    0
  357.  
  358. StructEnd.TXT:
  359.     dc.b    10
  360.     dc.b    "StructEnd routine called.",10,10
  361.     dc.b    "This routine has been called when player stops or the",10
  362.     dc.b    "module will be killed. This routine deallocates",10
  363.     dc.b    "the structure memory.",10
  364.     dc.b    0
  365.  
  366. *-----------------------------------------------------------------------------*
  367. *-- Check if the module is a TestPlayer-Module (THIS ROUTINE MUST EXIST!!!) --*
  368. *-----------------------------------------------------------------------------*
  369.         even
  370. Check:        move.l    dtg_ChkData(a5),a0    ; get module base from DT
  371.         moveq    #0,d0                ; clear register
  372.         cmpi.l    #'TEST',(a0)            ; supported type ?
  373.         sne    d0                ; no - signal false
  374.         bne.s    .NotFound
  375.         lea    Check.TXT(pc),a2
  376.         bsr    DisplayMsg            ; output
  377.         moveq    #0,d0
  378. .NotFound:    rts                    ; leave
  379.  
  380. *-----------------------------------------------------------------------*
  381. *-------------------------- Initialize the player ----------------------*
  382. *-----------------------------------------------------------------------*
  383. InitPlay:    lea    InitPlayer.TXT(pc),a2        ; fetch text
  384.         bsr    DisplayMsg            ; output
  385.         moveq    #0,d0                ; no error
  386.         rts
  387.  
  388. *-----------------------------------------------------------------------*
  389. *---------------------------- Clean up the player ----------------------*
  390. *-----------------------------------------------------------------------*
  391. EndPlay:    lea    EndPlayer.TXT(pc),a2        ; fetch text
  392.         bra    DisplayMsg            ; output
  393.  
  394.  
  395. *-----------------------------------------------------------------------*
  396. *--------------------------- Initialize the module ---------------------*
  397. *-----------------------------------------------------------------------*
  398. InitSnd:    lea    InitSound.TXT(pc),a2        ; fetch text
  399.         bra    DisplayMsg            ; output
  400.  
  401.  
  402. *-----------------------------------------------------------------------*
  403. *------------------------------- End sound -----------------------------*
  404. *-----------------------------------------------------------------------*
  405. EndSnd:        lea    EndSound.TXT(pc),a2        ; fetch text
  406.         bra    DisplayMsg            ; output
  407.  
  408.  
  409. *-----------------------------------------------------------------------*
  410. *------------------------------ Start interrupts -----------------------*
  411. *-----------------------------------------------------------------------*
  412. StartInt:    lea    StartInt.TXT(pc),a2        ; fetch text
  413.         bra    DisplayMsg            ; output
  414.  
  415.  
  416. *-----------------------------------------------------------------------*
  417. *------------------------------- Stop interrupts -----------------------*
  418. *-----------------------------------------------------------------------*
  419. StopInt:    lea    StopInt.TXT(pc),a2        ; fetch text
  420.         bra    DisplayMsg            ; output
  421.  
  422.  
  423. *-----------------------------------------------------------------------*
  424. ;
  425. ; IMPORTANT NOTE:
  426. ;    There is a BIG difference between the »Config« and the
  427. ;    »UserConfig« Routine !!! The Config routine is immediately
  428. ;    called after that the Player is loaded. It is used to
  429. ;    configure player (e.g. load config file and set pathes)!
  430. ;    The UserConfig routine is only called if the User selects
  431. ;    the player in the PrefWindow and presses the Config Player
  432. ;    GADGET. This routine is thought as a method of getting
  433. ;    informations (playerspecific preferences) from the user
  434. ;    (e.g. pathes for instruments or maximum memory usage).
  435. ;    The difference between Config and InitPlayer is that
  436. ;    Config is called ONCE the player is loaded and that
  437. ;    InitPlayer is called every time a module is played.
  438. ;
  439. *-----------------------------------------------------------------------*
  440. *----- get/set playerspecific preferences (configuration routines) -----*
  441. *-----------------------------------------------------------------------*
  442. ConfigPlayer:    lea    ConfigPlayer.TXT(pc),a2        ; fetch text
  443.         bra    DisplayMsg            ; output
  444.  
  445. UserConfig:    lea    UserConfig.TXT(pc),a2        ; fetch text
  446.         bsr    DisplayMsg            ; output
  447.         moveq    #0,d0                ; no error
  448.         rts
  449.  
  450. LoadConfig:    lea    LoadConfig.TXT(pc),a2        ; fetch text
  451.         bsr    DisplayMsg            ; output
  452.         moveq    #0,d0                ; no error
  453.         rts
  454.  
  455. SaveConfig:    lea    SaveConfig.TXT(pc),a2        ; fetch text
  456.         bsr    DisplayMsg            ; output
  457.         moveq    #0,d0                ; no error
  458.         rts
  459.  
  460.  
  461. *-----------------------------------------------------------------------*
  462. *----------------------------- Patterncontrol --------------------------*
  463. *-----------------------------------------------------------------------*
  464. NextPatt:    lea    NextPattern.TXT(pc),a2        ; fetch text
  465.         bra    DisplayMsg            ; output
  466.  
  467. PrevPatt:    lea    PrevPattern.TXT(pc),a2        ; fetch text
  468.         bra    DisplayMsg            ; output
  469.  
  470. GetPositionNr:    lea    GetPositionNr.TXT(pc),a2    ; fetch text
  471.         bsr    DisplayMsg            ; output
  472.         moveq    #1,d0                ; PatternNr
  473.         rts
  474.  
  475.  
  476. *-----------------------------------------------------------------------*
  477. *------------------------------ Subsongcontrol -------------------------*
  478. *-----------------------------------------------------------------------*
  479. SubSongRange:    lea    SubSongRange.TXT(pc),a2        ; fetch text
  480.         bsr    DisplayMsg            ; output
  481.         moveq    #0,d0
  482.         moveq    #2,d0
  483.         rts
  484.  
  485. NextSubSong:    lea    NextSubSong.TXT(pc),a2        ; fetch text
  486.         bra    DisplayMsg            ; output
  487.  
  488. PrevSubSong:    lea    PrevSubSong.TXT(pc),a2        ; fetch text
  489.         bra    DisplayMsg            ; output
  490.  
  491.  
  492. *-----------------------------------------------------------------------*
  493. *------------------------------ Speedcontrol ---------------------------*
  494. *-----------------------------------------------------------------------*
  495. Faster:        lea    SpeedFaster.TXT(pc),a2        ; fetch text
  496.         bra    DisplayMsg            ; output
  497.  
  498. Slower:        lea    SpeedSlower.TXT(pc),a2        ; fetch text
  499.         bra    DisplayMsg            ; output
  500.  
  501. SetSpeed:    lea    SetSpeed.TXT(pc),a2        ; fetch text
  502.         bra    DisplayMsg            ; output
  503.  
  504. *-----------------------------------------------------------------------*
  505. *--------------------------- ModuleInfocontrol -------------------------*
  506. *-----------------------------------------------------------------------*
  507. Get_ModuleInfo:    lea    GetModuleInfo.TXT(pc),a2    ; fetch text
  508.         bsr    DisplayMsg            ; output
  509.         sub.l    a0,a0
  510.         rts
  511.  
  512. Free_ModuleInfo:lea    FreeModuleInfo.TXT(pc),a2    ; fetch text
  513.         bra    DisplayMsg            ; output
  514.  
  515. *-----------------------------------------------------------------------*
  516. *-------------------------- SampleInfo-Control -------------------------*
  517. *-----------------------------------------------------------------------*
  518. SampleInit:    lea    SampleInit.TXT(pc),a2        ; fetch text
  519.         bsr    DisplayMsg            ; output
  520.         sub.l    a0,a0
  521.         rts
  522.  
  523. SampleEnd:    lea    SampleEnd.TXT(pc),a2        ; fetch text
  524.         bra    DisplayMsg            ; output
  525.  
  526.  
  527. *-----------------------------------------------------------------------*
  528. *------------------ UserProgramm-Structure-Control ---------------------*
  529. *-----------------------------------------------------------------------*
  530. StructInit:    lea    StructInit.TXT(pc),a2        ; fetch text
  531.         bsr    DisplayMsg            ; output
  532.         sub.l    a0,a0
  533.         rts
  534.  
  535. StructEnd:    lea    StructEnd.TXT(pc),a2        ; fetch text
  536.         bra    DisplayMsg            ; output
  537.  
  538. *-----------------------------------------------------------------------*
  539. *------------------ UserProgramm-Structure-Control ---------------------*
  540. *-----------------------------------------------------------------------*
  541. ModuleChange:    lea    ModuleChange.TXT(pc),a2        ; fetch text
  542.         bra    DisplayMsg            ; output
  543.  
  544. ModuleRestore:    lea    ModuleRestore.TXT(pc),a2        ; fetch text
  545.         bra    DisplayMsg            ; output
  546.  
  547.  
  548. *-----------------------------------------------------------------------*
  549. *------------------ Volume & Balance & Voice Control -------------------*
  550. *-----------------------------------------------------------------------*
  551. Volume:        lea    Volume.TXT(pc),a2        ; fetch text
  552.         bra    DisplayMsg            ; output
  553.  
  554. Balance:    lea    Balance.TXT(pc),a2        ; fetch text
  555.         bra    DisplayMsg            ; output
  556.  
  557. Voices:        lea    Voices.TXT(pc),a2        ; fetch text
  558.         bra    DisplayMsg            ; output
  559.  
  560.  
  561. *-----------------------------------------------------------------------*
  562. *-------------------------------- Save ---------------------------------*
  563. *-----------------------------------------------------------------------*
  564. Save:        lea    Save.TXT(pc),a2
  565.         bra.w    DisplayMsg
  566.  
  567. *-----------------------------------------------------------------------*
  568. *---------------------------- Subroutines ------------------------------*
  569. *-----------------------------------------------------------------------*
  570. DisplayMsg:    lea    reqname(pc),a1
  571.         move.l    4.w,a6
  572.         jsr    _LVOOldOpenLibrary(a6)        ; open req.library
  573.         tst.l    d0
  574.         beq.s    DisplayEnd            ; library open failed
  575.  
  576.         lea    TextStruct(pc),a0        ; address of text structure
  577.         move.l    a2,(a0)                ; copy text pointer to block
  578.         move.l    d0,a6                ; get ReqBase address
  579.         jsr    _LVOTextRequest(a6)        ; print the message
  580.  
  581.         move.l    a6,a1
  582.         move.l    4.w,a6
  583.         jsr    _LVOCloseLibrary(a6)        ; close req.library
  584. DisplayEnd:    rts                    ; bye!
  585.  
  586.